#pragma once
#include "ClientSocket.h"
#include "Msg.h"

class CClientSocket;
class CNetClient
{
public:
	CNetClient();
	virtual ~CNetClient();

	BOOL Connect(const char *szServerAddr,int nServerPort, int nOrigin);
	virtual Msg* CreateMsg(DWORD dwMsgId, int nLen) = 0;
	virtual BOOL OnMsg(Msg *pMsg) = 0;
	virtual void OnSocketClose() {};
	BOOL SendMsg(Msg *pMsg);
	CClientSocket m_socket;
	int m_nOrigin;
};
